package net.csdn.business.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: zhangyalei
 * @Date: 2023/1/30 18:13
 * @Description: cla签约状态枚举
 */
@Getter
@AllArgsConstructor
public enum ClaSignStatusEnum {
    /**
     * 未签署（数据库不存在）
     */
    UNSIGNED(-1, "未签署"),
    NEED_RESIGN(2, "需要重新签署"),
    SIGNED(1, "已签署"),
    REVOKED(0, "已撤销");

    private final Integer code;
    private final String desc;

    public static ClaSignStatusEnum ofCode(int code) {
        for (ClaSignStatusEnum signStatus : ClaSignStatusEnum.values()) {
            if (signStatus.code.equals(code)) {
                return signStatus;
            }
        }
        return null;
    }
}